import axiosReq from '@/utils/axios-req'
const BASE_URL = import.meta.env.VITE_APP_BASE_URL_LLY

/**
 * 评标记录-列表
 * @param data 
 * {
    "supplierName": "",
    "pageNo": 1,
    "pageSize": 10
}
 * @returns 
 */
export const recordInfoList = (data: any) => {
  const projectId = useProjectInfoStore().projectInfo.id
  return axiosReq({
    baseURL: BASE_URL,
    url: `/cloud/pbgl/recordInfo/list`,
    method: 'POST',
    data: {
      ...data,
      projectId
    }
  })
}

/**
 * 评标记录-新增修改
 * @param data 
 * {
    "id": "1",
    "orderNo": "1",
    "supplierIds": "1,2",
    "supplierNames": "公司1,公司3",
    "stepCode":"INVALID",
    "stepName":"无效标",
    "itemId":"1",
    "itemName":"xx审批",
    "comment":"xxx"
}
 * @returns 
 */
export const recordInfoSaveUpdate = (data: any) => {
  const projectId = useProjectInfoStore().projectInfo.id
  return axiosReq({
    baseURL: BASE_URL,
    url: `/cloud/pbgl/recordInfo/saveUpdate`,
    method: 'POST',
    data: {
      ...data,
      projectId
    },
    showMsg: true
  })
}

/**
 * 评标记录-删除
 * @param data [
    1
]
 * @returns 
 */
export const recordInfoRemove = (data: any) => {
  return axiosReq({
    baseURL: BASE_URL,
    url: `/cloud/pbgl/recordInfo/remove`,
    method: 'POST',
    data,
    showMsg: true
  })
}

/**
 * 评标记录-查看
 * @param data 
 * {
    "id": "1"
}
 * @returns 
 */
export const recordInfoDetail = (params: any) => {
  return axiosReq({
    baseURL: BASE_URL,
    url: `/cloud/pbgl/recordInfo/view`,
    method: 'GET',
    params
  })
}
